package com.ruoyi.core.lock.enums;


import com.ruoyi.core.lock.IExpressionActuator;
import com.ruoyi.core.lock.actuator.DefaultActuator;
import com.ruoyi.core.lock.actuator.ExpressionActuator;
import com.ruoyi.core.lock.actuator.OriginalActuator;
import com.ruoyi.core.lock.actuator.ParamActuator;
import lombok.Getter;

/**
 * @Author xiaom
 * @Date 2020/3/16 11:05
 * @Version 1.0.0
 * @Description <>
 **/
@Getter
public enum LockType {
    EXPRESSION_TYPE{
        @Override
        public IExpressionActuator getActuator() {
            return new ExpressionActuator();
        }
    },
    EXPRESSION_PARAM_TYPE {
        @Override
        public IExpressionActuator getActuator() {
            return new ParamActuator();
        }
    },
    EXPRESSION_ORIGINAL_TYPE{
        @Override
        public IExpressionActuator getActuator() {
            return new OriginalActuator();
        }
    },
    DEFAULT_TYPE{
        @Override
        public IExpressionActuator getActuator() {
            return new DefaultActuator();
        }
    };

    /**
     * Get corresponding expression executor
     */
    public abstract IExpressionActuator getActuator();
}
